#pragma once
#include "UIAnimationBase.h"

namespace DirectUI
{
	namespace UIAnimation
	{
		interface __declspec(uuid("7C240C00-77B4-4A65-885D-42A80F30BAC7")) IUIDoubleKeyFrame : public IUIObject
		{
			virtual double		GetValue() = 0;
			virtual void		SetValue(double value) = 0;
			virtual UITIMESPAN	GetKeyTime() = 0;
			virtual	void		SetKeyTime(UITIMESPAN time) = 0;
		}; 

		interface __declspec(uuid("A9DB9EB3-9DD4-4E76-88CE-6CC2B226C852")) IUIColorKeyFrame : public IUIObject
		{
			virtual UICOLOR		GetValue() = 0;
			virtual void		SetValue(UICOLOR value) = 0;
			virtual UITIMESPAN	GetKeyTime() = 0;
			virtual	void		SetKeyTime(UITIMESPAN time) = 0;
		}; 

		interface __declspec(uuid("FDBE7C38-5B1B-40B7-A986-451889778427")) IUIDoubleAnimationUsingKeyFrames : public IUITimeline
		{

		};
		/*
		template <typename T, typename Q>
		class CUIKeyFrameBase : public CUINoAggregateObjectImplHelper<Q>
		{
		public:
		CUIKeyFrameBase() : m_KeyTime(0) { }
		virtual T			GetValue() { return m_Value; }
		virtual void		SetValue(T value) { m_Value = value; }
		virtual UITIMESPAN	GetKeyTime() { return m_KeyTime; }
		virtual	void		SetKeyTime(UITIMESPAN time) { m_KeyTime = time; }
		protected:
		UITIMESPAN	m_KeyTime;
		T			m_Value;
		};

		class CUIDoubleKeyFrame  : public CUIKeyFrameBase<double, IUIDoubleKeyFrame>
		{
		public:
		CUIDoubleKeyFrame() { m_Value = 0; }
		};
		class CUIColorKeyFrame : public CUIKeyFrameBase<UICOLOR, IUIColorKeyFrame>
		{
		public:
		CUIColorKeyFrame() { m_Value = 0; }
		};

		template <typename Baseclass, typename InterfaceType>
		class AnimationUsingKeyFramesBase : public Baseclass
		{
		protected:
		std::vector<CUIObjectPtr<InterfaceType>>	m_spKeyFrames;
		};

		class CUIDoubleAnimationUsingKeyFrames
		: public AnimationUsingKeyFramesBase<
		CUIAnimationBase<CUITimeline<IUIDoubleAnimationUsingKeyFrames>, CUIDoubleAnimationUsingKeyFrames>
		, IUIDoubleKeyFrame>
		{
		public:
		DECLARE_CLASS_NAME("DoubleAnimationUsingKeyFrames")

		public:
		CUIDoubleAnimationUsingKeyFrames();
		~CUIDoubleAnimationUsingKeyFrames();

		public:
		class CAnimationTimerTask
		{
		public:
		virtual void OnTaskInit(CUIAnimationTimerData* pData);
		virtual BOOL DoTimerTask();
		virtual void ChangeColorProperty(UICOLOR value);

		private:
		CUIAnimationTimerData* m_pTimerTaskData;
		};

		virtual bool	CheckValid();
		virtual void	OnComplete();
		virtual void	OnParseAttribute(xml_attribute& attr, LPCTSTR lpAttrAlias);
		};

		template<>
		struct CUIAnimationTimerTask<CUIDoubleAnimationUsingKeyFrames>
		{
		typedef CUIDoubleAnimationUsingKeyFrames::CAnimationTimerTask Task;
		};*/
	}

}

